package com.example.mytv;

import java.util.ArrayList;
import java.util.List;

public final class MovieList {
    public static final String MOVIE_CATEGORY[] = {
            "电影",
            "电视剧",
            "动漫",
            "少儿",
            "直播",
            "Category Five",
    };

    private static List<Movie> list;
    private static long count = 0;

    public static List<Movie> getList() {
        if (list == null) {
            list = setupMovies();
        }
        return list;
    }

    public static List<Movie> setupMovies() {
        list = new ArrayList<>();
        String title[] = {
                "Welcocme test1",
                "武动青春",
                "生死格斗",
                "致命信条",
                "超级宝贝JOJO",
        };

        String description[] = {"Fusce id nisi turpis. Praesent viverra bibendum semper. ",
                "影片讲述一群年轻人对中国传统武术的追求。大张伟扮演超级搞笑人物华子，献上了一段段闹剧。导演寇占文以及主演：花儿乐队主唱大张伟、华语超人气组合棒棒堂成员敖犬及阿纬、香港当红偶像傅颖和电影特别推荐的三位新人张驰、奇霖、党山鹏。 《武动青春》是一部青春励志来弘扬中华武术精神的动作电影，标榜不请替身、不用特效，力求以百分百真功夫完成所有拍摄，与此同时，剧情更是紧贴时下年轻人喜好，打破传统武术电影拍摄的一贯手法，从导演及演员的选择及整部电影剧情框架，都以全新概念示人，开创“新浪潮武术电影”新风潮！",
                "随着生母的去世和继母的到来，Amrita Jayshankar变得孤僻。父亲被叫到学校，被告知她需要心理咨询，但父亲拒绝相信，而且捐款给学校。Amrita结识了3个男性和一个女性，分别叫做Zuben、Dushant Sahu、Karan Chaudhary和Tanya Sharma，他们在一起酗酒吸毒。后来不小心杀了一对夫妻，事情失去了控制，一个腐败警察索要250万来帮他们开脱，由于弄不到这笔钱，5人决定假装绑架，向Amrita的父亲勒索现金，洗刷自己的干系，于是Amrita“失踪”，其父亲报警，任务被分配给了曾被停职的警察Arvind Mathur，媒体也牵涉其中…"                + "amet mi accumsan mollis sed et magna. Vivamus sed aliquam risus. Nulla eget dolor in elit ",
                "facilisis mattis. Ut aliquet luctus lacus. Phasellus nec commodo erat. Praesent tempus id ",
                "适龄启蒙，亲子共学。宝宝的成长从很多个第一次开始，第一次学说话、第一次学走路。《超级宝贝JOJO》专为1-3岁宝宝设计，以小宝宝JOJO的成长生活中常见场景趣事吸引宝宝模仿学习，激发宝宝的语言表达与探."};

        String studio[] = {
                "Studio Zero", "Studio One", "Studio Two", "Studio Three", "Studio Four"
        };
        String videoUrl[] = {
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review.mp4",
                "https://xigua-cdn.haima-zuida.com/20200203/1882_ed4a7319/index.m3u8",
                "https://jingdian.qincai-zuida.com/20200521/7459_dfe5bc4e/index.m3u8",
                "https://youku.cdn10-okzy.com/20200315/13096_efd4b733/index.m3u8",
                "https://iqiyi.cdn9-okzy.com/20200315/7495_1e30ef54/index.m3u8",
        };
        String bgImageUrl[] = {
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review/bg.jpg",
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Fiber%20to%20the%20Pole/bg.jpg",
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Nose/bg.jpg",
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review/bg.jpg",
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review/bg.jpg",
        };
        String cardImageUrl[] = {
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review/card.jpg",
                "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Demo%20Slam/Google%20Demo%20Slam_%2020ft%20Search/card.jpg",
                "https://tu.tianzuida.com/pic/upload/vod/2020-05-22/202005221590131912.jpg",
                "https://images.cnblogsc.com/pic/upload/vod/2020-03/1584230424.jpg",
                "https://images.cnblogsc.com/pic/upload/vod/2020-03/202003091583749396.jpg",
        };

        for (int index = 0; index < title.length; ++index) {
            list.add(
                    buildMovieInfo(
                            title[index],
                            description[index],
                            studio[index],
                            videoUrl[index],
                            cardImageUrl[index],
                            bgImageUrl[index]));
        }

        return list;
    }

    private static Movie buildMovieInfo(
            String title,
            String description,
            String studio,
            String videoUrl,
            String cardImageUrl,
            String backgroundImageUrl) {
        Movie movie = new Movie();
        movie.setId(count++);
        movie.setTitle(title);
        movie.setDescription(description);
        movie.setStudio(studio);
        movie.setCardImageUrl(cardImageUrl);
        movie.setBackgroundImageUrl(backgroundImageUrl);
        movie.setVideoUrl(videoUrl);
        return movie;
    }
}